* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(#ccc,rgb(5,1,36));
}
.container {
    position: relative;
    width: 200px;
    height: 200px;
    transform-style: preserve-3d;
    transform: rotateX(-20deg) rotateY(20deg);
    animation: rotate 3s  linear forwards infinite;
}
.container .item {
    position: absolute;
    width: 100%;
    height: 100%;
}
.item img {
    width: 200px;
    height: 200px;
}
.container .front {
    transform: translateZ(100px);
}
.container .back {
    transform: rotateY(180deg) translateZ(100px);
}
.container .left {
    transform: rotateY(-90deg) translateZ(100px);
}
.container .right {
    transform: rotateY(90deg) translateZ(100px);
}
.container .top {
    transform: rotateX(90deg) translateZ(100px);
}
.container .bottom {
    transform: rotateX(-90deg) translateZ(100px);
}
@keyframes rotate {
    0%,5% {
        transform: rotateY(90deg);
    }
    20%,25% {
        transform: rotateY(180deg);

    }
    40%,45% {
        transform: rotateY(270deg);

    }
    60%,65% {
        transform: rotateY(-90deg);
    }
    80%,85% {
        transform: rotateY(0deg);
    }
    95%,100% {
        transform: rotateY(90deg);
    }
}